package com.ma.netana.controller;

import com.ma.netana.dao.PacketDao;
import com.ma.netana.pojo.Packet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MongoTestCon {
    @Autowired
    private PacketDao packetDao;

    @GetMapping(value = "/test")
    @CrossOrigin
    public void saveP(){
        Packet packet = new Packet();
        packet.setCaplen(1);
        packet.setData(new byte[]{127,0,0,1});
        packet.setHeader(new byte[]{127,0,0,2});
        packet.setLen(1);
        packet.setSec(1);
        packet.setUsec(1);
        System.out.println("save"+" "+packet);
        //packetDao.savePacket(packet);
    }
}
